package org.example.im.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    
    @Value("${file.static-access-path}")
    private String staticAccessPath;
    
    @Value("${file.static-resources-locations}")
    private String staticResourcesLocations;
    
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 配置静态资源映射
        registry.addResourceHandler(staticAccessPath)
                .addResourceLocations(staticResourcesLocations);
    }
} 